#! -*- encoding:utf-8 -*-
"""
@File    :   serializers.py
@Author  :   Zachary Li
@Contact :   li_zaaachary@163.com
@Dscpt   :   restful api
"""

from django.contrib.auth import get_user_model
from rest_framework import serializers

from .models import MRCAnswer, Post


class PostSerializer(serializers.ModelSerializer):

    class Meta:
        model = Post
        fields = ['id', 'question', 'mrc_answered']
        read_only_fields  = ['id', 'question']


class MRCAnswerSerializer(serializers.ModelSerializer):

    class Meta:
        model = MRCAnswer
        fields = ['question', 'context', 'start', 'end']
        
